package com.fang.mmy.user.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Component;

/**
 * @ClassName UserSentinelResourceHandler
 * @Author kebukeyi
 * @Date 2022/8/7 16:34
 * @Description
 * @Version 1.0.0
 */
@Component
public class UserSentinelResourceHandler {

    public static String sentinelAResource(Throwable throwable) {
        System.out.println("触发熔断，服务不可用");
        return "触发熔断，服务不可用";
    }

    public static String hotspotResource(String userId, String shopId, BlockException blockException) {
        System.out.println("您被认为恶意访问，触发热点限流");
        return "您被认为恶意访问，触发热点限流";
    }


}
